<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@include file="/commons/include/html_doctype.html"%>
<html>
	<head>
		<title>职位信息表列表</title>
		<%@include file="/commons/include/get.jsp"%>
		<script type="text/javascript" src="${ctx }/js/util/util.js"></script>
		<script type="text/javascript">
		var isMulti=${isMulti};
		$(function(){
			//全选。
			$("#checkall").click(function(){
				checkall("userIds",this.checked);
			});
		});
		
		function getSelectUsers()
		{
			var isMulti="${isMulti}";
			if(isMulti==1)
			{
				var arySelected=$("input[name='userIds']:checked");
				var str="["
				var k=arySelected.length;
				for(var i=0;i<k;i++)
				{
					var obj=arySelected[i];
					var name=obj.getAttribute("username");
					if(i<k-1)
						str+="{'userId':'"+obj.value+"','name':'"+name+"'},";
					else
						str+="{'userId':'"+obj.value+"','name':'"+name+"'}";
				}
				str+="]";
				return str;
			}
			else
			{
				var arySelected=$(".radio:checked");
			
				var str="["
				if(arySelected.length==1)
			 	{
			 		var obj=arySelected[0];
					var userid=obj.value;
					var name=obj.getAttribute("username");
					str+="{'userId':'"+userid+"','name':'"+name+"'}";
				}
				str+="]";
			 
				return str;
			}
		}
	</script>
		<style type="text/css">
body {
	margin: 0 0 0 0;
}
</style>
	</head>
	<body>
		<table border="0" cellspacing="1" cellpadding="0" class="listTable">
			<tr class="list_title">
				<td style="width: 3%">
					<c:choose>
						<c:when test="${isMulti==1}">
							<input id="checkall" type="checkbox" />
						</c:when>
						<c:otherwise>
						&nbsp;
					</c:otherwise>
					</c:choose>
				</td>
				<td>
					用户账号
				</td>
				<td>
					用户姓名
				</td>
			</tr>
				<c:forEach items="${pageModel.result}" var="d" varStatus="status">
					<tr class="${status.index%2==0?'list_even':'list_odd'}">
						<td nowrap="nowrap">
							<c:choose>
								<c:when test="${isMulti==1}">
									<input name="userIds" type="checkbox" value="${d.id}"
										username="${d.name}" />
								</c:when>
								<c:otherwise>
									<input class="radio" name="userId" type="radio"
										value="${d.id }" username="${d.name}" />
								</c:otherwise>
							</c:choose>
						</td>
						<td>
							${d.account}
						</td>
						<td>
							${d.name}
						</td>
					</tr>
				</c:forEach>
		</table>
		<table border="0" cellspacing="0" cellpadding="0" class="bottomTable">
			<tr>
				<td>
					${pageNav.page}
				</td>
			</tr>
		</table>
	</body>
</html>
